<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>ADMIN</title>
    <link rel="stylesheet" th:href="@{/css/admin/base.css}">
    <link rel="stylesheet" th:href="@{/lib/font-awesome/4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/css/admin/app.css}">
</head>

<body>
    <div class="app-login">
        <div class="container">
            <div class="header">
                <h1 class="title">后台登录</h1>
            </div>
            <form class="login-form">
                <div class="form-item col">
                    <label class="label">账号</label>
                    <input type="text" placeholder="请输入账号" name="nickname" data-name="账号" data-rule="required">
                </div>
                <div class="form-item col">
                    <label class="label">密码</label>
                    <input type="password" placeholder="请输入密码" name="password" data-name="密码" data-rule="required">
                </div>
                <div class="form-msg"></div>
                <div class="form-column z-btn-row">
                    <a class="btn-sub z-btn z-btn-l z-primary">登录</a>
                </div>
            </form>
        </div>
    </div>

    <script th:src="@{lib/jquery.min.js}"></script>
    <script th:src="@{/js/form.js}"></script>
    <script th:src="@{/js/popup.js}"></script>
    <script>
        var form = $(".login-form").form({
            msg: function(msg) {
                popup.tips(msg)
            },
            submit: function() {
                var data = {}

                $.each($(".login-form").serializeArray(), function(index, field) {
                    data[field.name] = field.value;
                })

                console.log('data');
                console.log(data);
                location.href = "index.html"
            }
        })
    </script>
</body>

</html>